package edu.cmu.cs.webapp.ioms.ui.wizards.formula;

import org.eclipse.jface.wizard.Wizard;

import edu.cmu.cs.webapp.ioms.models.FormularRecord;
import edu.cmu.cs.webapp.ioms.models.impl.IOMSFactoryImpl;

public class FormularWizard extends Wizard {
	
	private FormulaMainWizard _generalPage;
//	private IngredientWizardPage _clientPage;
	private boolean _isUpdate;
	private FormularRecord _model;


	public FormularWizard(boolean update, FormularRecord model) {
		_isUpdate = update;
		this._model= model;
		
		
		
	}

	public void addPages(){
		_generalPage = new FormulaMainWizard("Formula information management Page");
		addPage(_generalPage);
		
//		_clientPage = new OrderCustomerWizardPage("Customer Page");
//		addPage(_clientPage);
//		_cardPage = new OrderItemWizardPage("Card Page");
//		addPage(_cardPage);
	}
	
	@Override
	public boolean performFinish() {
		if (_model == null) {
			_model = IOMSFactoryImpl.eINSTANCE.createFormularRecord();
		}
		_model=_generalPage.getFormRecord();
		return true;
	}

	public boolean isUpdate() {
		return _isUpdate;
	}

	public FormularRecord getModel() {
		// TODO Auto-generated method stub
		return this._model;
	}

}
